# -*- coding: utf-8 -*-
"""
Created on Mon Apr  3 22:02:27 2017
euler project 51
@author: zhiqiang
"""
from euler49 import is_prime

from itertools import combinations
from collections import Counter
num = 101
primes = []
while True:
    digits = len(num)
    can_be_replace = range(digits)
    if num not in primes and not is_prime(num):
        num += 2
        continue
    else:
        if num not in primes:
            primes.append(num)
            for num_replace in range(1,digits):
                for digits_replace in combinations(can_be_replace,num_replace):
                    #将所有变化放出来，查看是不是8个
                    #要求两位以上变化时，要查验原数字在这两位上是不是相同的数字，如果不是直接continue
            
        else:
            num += 2
            continue